package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

//import nl.coderight.jazz.dialog.MessageDialog;
//import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.RbFolder;
//import jtk.project4.fleet.domain.VendorType;
import jtk.project4.fleet.domain.SecForms;


public class RbFolderDao extends IbatisDao{
	
	public List selectVendors() throws SQLException {
		List selectVendors = null;
			selectVendors =getSqlMap().queryForList("SELECT_ALL_VENDOR", null);
		return selectVendors;
	}

	public int deleteRbFolder(RbFolder rbFolder) throws SQLException{
		return (int) getSqlMap().delete("DELETE_RBFOLDER", rbFolder);
	}
	
	public int updateRbFolder(RbFolder rbFolder) throws SQLException{
		return (int) getSqlMap().update("UPDATE_RBFOLDER", rbFolder);
	}
	
	public RbFolder insertRbFolder(RbFolder rbFolder) throws SQLException{
		return (RbFolder) getSqlMap().insert("INSERT_RBFOLDER", rbFolder);
	}
	
	public RbFolder selectRbFolder(int id) throws SQLException {
		return (RbFolder) getSqlMap().queryForObject("SELECT_RBFOLDER", id);
	}
/*
	public Vendor insertVendorType(Vendor vendor) throws SQLException {
		return (Vendor) getSqlMap().insert("INSERT_VENDOR_TYPE",vendor);
	}
		*/
		public List selectRbFolder() throws SQLException {
		return getSqlMap().queryForList("select_all_rbfolder", null);
	}
	
		
	public static void main (String args[]) throws SQLException{
			
			RbFolder rbFolder = new RbFolder();
			//rbFolder = new RbFolder();
			//rbFolder.setName("Hasemberr");
			rbFolder = new RbFolderDao().selectRbFolder(1);
			rbFolder.setName("dia tak bertulang");
			new RbFolderDao().updateRbFolder(rbFolder);
			//rbFolder.setFolderId(4);
			//new RbFolderDao().deleteRbFolder(rbFolder);
			}
		
		
	
}